package com.yundong.gongchengji.ui.my.activity;

import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;

import com.yundong.gongchengji.R;
import com.yundong.gongchengji.base.BaseActivity;
import com.yundong.gongchengji.ui.my.adapter.CollectAdapter;
import com.yundong.gongchengji.ui.my.adapter.CollectDecoration;

/**
 * 我的收藏
 * Created by ls on 2017/2/21.
 */

public class MyCollectionActivity extends BaseActivity implements CollectAdapter.IonSlidingViewClickListener{
    private RecyclerView recycleCollect;
    private CollectAdapter collectAdapter;
    @Override
    public int getContentViewId() {
        return R.layout.activity_my_collection;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        setLeft();
        setTitle("我的收藏");

        recycleCollect= (RecyclerView) findViewById(R.id.recycle_collect);
        setAdapter();
    }
    private void setAdapter(){

        recycleCollect.setLayoutManager(new LinearLayoutManager(this));
        recycleCollect.setAdapter(collectAdapter = new CollectAdapter(this));
        recycleCollect.setItemAnimator(new DefaultItemAnimator());
        //这句就是添加我们自定义的分隔线
        recycleCollect.addItemDecoration(new CollectDecoration(this, CollectDecoration.VERTICAL_LIST));

    }
    @Override
    protected void initVariable() {

    }

    @Override
    protected void processLogic(Bundle savedInstanceState) {

    }

    @Override
    public void onItemClick(View view, int position) {
        Log.i("fsdfsdf","点击项："+position);
    }

    @Override
    public void onDeleteBtnCilck(View view, int position) {
        Log.i("fsdfsdf","删除项："+position);

    }
}
